<#assign dialogId = nowTimestamp.getTime()/>

<div class="add-category-container">
    <div class="inner">
        <div class="add-category-button">
        <a href="#" id="add-category-button" title="${uiLabelMap.RestaurantCreateNewCategory}">
            <i class="fa fa-plus"></i>
        </a>
        </div>
    </div>
</div>
<div id="${dialogId}" title="${uiLabelMap.RestaurantCreateNewCategory}">
  <p id="errorMessage${dialogId}"></p>
  <form name="createNewCategory" action="<@ofbizUrl>createNewCategory</@ofbizUrl>" method="post">
    <table class="basic-table" cellspacing="0">
          <tbody>
          <tr>
            <td class="label">${uiLabelMap.CommonName}</td>
            <td><input type="text" name="categoryName" id="name" value="" class="text ui-widget-content ui-corner-all"></td>
          </tr>
          <#-- tr>
            <td class="label">${uiLabelMap.CommonDescription}</td>
            <td><input type="text" name="description" id="email" value="" class="text ui-widget-content ui-corner-all"></td>
          </tr -->
          <tr>
            <td></td>
            <td><input type="submit" tabindex="-1" style="position:absolute; top:-1000px"></td>
          </tr>
        </tbody>
    </table>
  </form>
</div>
<script>
$(document).ready(function() {
    function createNewCategory () {
        submitDialogForm("${dialogId}", document.createNewCategory);
        return false;
    }
    dialog = $( "#${dialogId}" ).dialog({
      autoOpen: false,
      height: 200,
      width: 350,
      modal: true,
      buttons: {
        "${StringUtil.wrapString(uiLabelMap.RestaurantSave)}": createNewCategory,
        "${StringUtil.wrapString(uiLabelMap.RestaurantCancel)}": function() {
          dialog.dialog( "close" );
        }
      },
      close: function() {
        document.createNewCategory.reset();
      }
    });
    
    $("#add-category-button").button().on( "click", function() {
        dialog.dialog( "open" );
    });
  });

  </script>